const singer = [{
		name: '周杰伦',
		age: 34
	},
	{
		name: '许嵩',
		age: 34
	},
	{
		name: '邓紫棋',
		age: 44
	},
	{
		name: '张碧晨',
		age: 44
	},
	{
		name: '薛之谦',
		age: 44
	},
	{
		name: '封茗囧菌',
		age: 44
	},
]

// singer和newSinger的内存地址不一样
// const newSinger = singer.map((item, index, arr) => {
// 	return item;
// })
// newSinger[0].age = 39
// console.log(singer);
// const newSinger1 = singer.map((item, index, arr) => {
// 	return item.age > 40;
// })
// console.log(newSinger1); //[ false, false, true, true, true, true ]
Array.prototype.my_map = function(callback) {
	const res = []
	for (let i = 0; i < this.length; i++) {
		res.push(callback(this[i], i, this))
	}
	return res
}

const newSinger = singer.my_map((item, index, arr) => {
	return item.age > 40;
})
console.log(newSinger); //[ false, false, true, true, true, true ]
